# 模型评估指标
evaluate_index <- function(err, t, k=1, true=NA){
  mse = mean(err ** 2)
  # mse = var(err)
  rmse = sqrt(mse)
  mae = mean(abs(err))
  mape = mean(abs(err / true))
  
  aic = t * log(mse) + 2 * (k + 2)
  aicc = aic + 2 * (k + 2) * (k + 3) / (t - k - 3)
  bic = t * log(mse) + (k + 2) * log(t)
  
  print(paste('mse', mse, sep = ':'))
  print(paste('rmse', rmse, sep = ':'))
  print(paste('mae', mae, sep = ':'))
  print(paste('mape', mape, sep = ':'))
  
  print(paste('aic', aic, sep = ':'))
  print(paste('aicc', aicc, sep = ':'))
  print(paste('bic', bic, sep = ':'))
}
